import React from 'react'
import {useNavigate} from "react-router-dom"
import { ProductCard  } from 'react-vant';
import {anyAction} from "../untils/index"
type Props = {
    childrenData:anyAction
}

const Son = (props:Props) => {
    const navigate=useNavigate()
    const gotodeils=(val:anyAction)=>{
        navigate("/deils/"+val.id,{state:val})
    }
  return (
    <div>
         {
                props.childrenData&&props.childrenData.map((item:anyAction,index:number)=>{
                 return  <ProductCard
                 onClick={()=>gotodeils(item)}
                 key={index}
                 title={item.title}
                 num={item.state}
                 price={item.price}
                 desc={item.info}
                 thumb={item.img}
                 />
                })
              }
    </div>
  )
}

export default Son